package com.zzyweb.rentalcarsys.exception;

import lombok.Data;

@Data
public class BusinessException extends RuntimeException {
    private Integer code;

    public BusinessException() {
        super(ErrorCode.UNKNOWN_ERROR.getDescription());
        this.code = ErrorCode.UNKNOWN_ERROR.getCode();
    }

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getDescription());
        this.code = errorCode.getCode();
    }
}
